package cn.com.cpic.insurance.rulecheck.core.rule;

import java.util.Set;

import cn.com.cpic.insurance.rulecheck.core.ModifiableMap;
import cn.com.cpic.insurance.rulecheck.core.SimpleModifiableMap;

/**
 * 
 * 
 * @author 代波
 * @since 2011-8-13
 */
public final class SimpleRules implements Rules {
	private static final long serialVersionUID = -8729198538515683134L;

	private final ModifiableMap<String, Rule> rSet;
	private final ModifiableMap<String, RuleGroup> rgSet;
	private final ModifiableMap<String, RuleConsumer<?>> rcSet;

	public SimpleRules() {
		this((Set<Rule>) null, null, null);
	}

	public SimpleRules(Set<Rule> cSet, Set<RuleGroup> csSet, Set<RuleConsumer<?>> rcSet) {
		this(new SimpleModifiableMap<String, Rule>(cSet), new SimpleModifiableMap<String, RuleGroup>(csSet),
				new SimpleModifiableMap<String, RuleConsumer<?>>(rcSet));
	}

	public SimpleRules(ModifiableMap<String, Rule> cSet, ModifiableMap<String, RuleGroup> csSet,
			ModifiableMap<String, RuleConsumer<?>> rcSet) {
		super();
		this.rSet = cSet;
		this.rgSet = csSet;
		this.rcSet = rcSet;
	}

	public ModifiableMap<String, Rule> getRuleSet() {
		return rSet;
	}

	public ModifiableMap<String, RuleGroup> getRuleGroupSet() {
		return rgSet;
	}

	public ModifiableMap<String, RuleConsumer<?>> getRuleConsumerSet() {
		return rcSet;
	}
}
